import settings from './settings'
export default {
  ssr: false,
  server: {
    port: settings.port, // default: 3000
    // host: '10.34.100.127', // default: localhost
    // host:"localhost",
    host: settings.host,
  },
  // disableHostCheck: true,
  modules: [
    '@nuxtjs/axios',
    '@nuxtjs/proxy'
  ],
  axios: {
    baseURL: settings.baseUrl + settings.prefix,
    prefix: "/apipay",
    proxy: settings.devEnv,
  },
  proxy: {
    '/apipay': {
      target: settings.baseUrl,
      pathRewrite: {
        '^/apipay': "/" + settings.prefix
      }
    }
  },
  head: {
    title: '',
    meta: [{
      charset: 'utf-8'
    },
    {
      name: 'viewport',
      content: 'width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no'
    }
    ],
    link: [{
      rel: 'icon',
      type: 'image/x-icon',
      href: '/favicon.ico'
    }]
  },
  css: [
    {
      src: '*.scss',
      lang: 'scss'
    }
  ],
  plugins: [
    '~/plugins/vant',
    '~/plugins/vue-map'
  ],
  build: {
    babel: {
      plugins: [
        [
          'import',
          {
            libraryName: 'vant',
            // 目前在 nuxt 中无法按需引入样式，因此采用手动引入的方式
            style: false
          },
          'vant'
        ]
      ]
    },
  },
  css: [
    "~assets/css/common.css"
  ],
  loaders: {
    imgUrl: { limit: 15000 }
    //10000
  },
};
